def gen(n):
    i = 1
    i = i + 1
    return n+i

def gen_yield(n):
    i = 1
    i = i + 1
    yield n+i

def gen_loop(n):
    for i in range(n):
        yield i

if __name__ == '__main__':
    # 查看返回值类型
    # print(type(gen(1)))
    # print(type(gen_yield(1)))

    i = gen(1)
    print(i)

    j = gen_yield(1)
    # print(j)
    print(next(j))

    l = gen_loop(10)
    print(next(l))
    print(next(l))
    print(next(l))
    print(next(l))